<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>采购审核</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<link rel="stylesheet" href="css/student_leave.css">
	<link rel="stylesheet" href="../css/main.css">
</head>

<body>
	<div id="container">
		<div class="contain">
			<div class="header">
				<div class="header_title">采购审核</div>
				<a onclick="history.back()">
					<img src="../image/return.png" alt="" class="return">
				</a>
			</div>
			<div style="height: 40px;"></div>
			<div class="leave_content" id="vue-root">
				<div class="approval" v-for="item in list" :key="item.id">
					<a :href="'audit_detail.html?id='+item.id">

						<div class="result2" :style="style(item.audit)" v-text="['审核','通过','驳回'][item.audit]"></div>

						<div class="list_content">
							<p>
								<span>采购人 :</span>
								<span v-text="item.buyer"></span>
							</p>
							<p>
								<span>物料名 :</span>
								<span v-text="item.materialname"></span>
							</p>
							<p>
								<span> 供应商 :</span>
								<span v-text="item.name"></span>
							</p>
							<p>
								<span>下单时间 :</span>
                                <span v-text="format(item.orderdata)"></span>
							</p>
						</div>
					</a>
				</div>
			</div>

		</div>
	</div>

	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/scriptZIP/dayjs.min.js"></script>
    <script src="/scriptZIP/qs.min.js"></script>
    <script src="/js/common.js"></script>

	<script>
        var xid=sessionStorage.getItem("xid")
        var xname=sessionStorage.getItem("xname")
		var app = new Vue({
			el: '#vue-root',
			data: {
				list: [
					{
						id:1,
						audit:1,
						buyer:'刘晓辉',
						materialname:'金枕榴莲',
						name:'华夏供应商',
						orderdata:'2021-11-12 05:54'
					},
				]
			},
			methods: {
				format: function (time) {
					if (!time) return '';
					return dayjs(time).format('YYYY-MM-DD HH:mm');
				},
				style: function (status) {
					var color = ['blue', 'green', 'red'][status];
					return {
						color: color,
						'border-color': color
					};
				},
			},
			created: function () {
			    /*if(xname=="经理"){
                    axios.get('/purchase/qppfindPurchasexid?xid='+xid).then(function (res) {
                        this.list = res.data.data;
                    }.bind(this));
                }else {
                    axios.get('/purchase/qppfindPurchasebuyer?buyer='+xname+'&xid='+xid).then(function (res) {
                        this.list = res.data.data;
                    }.bind(this));
                }*/


			}
		});

	</script>

</body>

</html>